﻿Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.ComponentModel
Imports eCart.BusinessEntity
Imports eCart.BusinessLogic
' To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
' <System.Web.Script.Services.ScriptService()> _
<System.Web.Services.WebService(Namespace:="http://tempuri.org/")> _
<System.Web.Services.WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<ToolboxItem(False)> _
Public Class wsCustomers
    Inherits System.Web.Services.WebService

    <WebMethod()> _
    Public Function GetListado() As List(Of beCustomers)
        Dim oBL As New blCustomers
        Return oBL.GetListado()
    End Function

    <WebMethod()> _
    Public Function GetListadoBusqueda(ByVal pBusqueda As String) As List(Of beCustomers)
        Dim oBL As New blCustomers
        Return oBL.GetListado(pBusqueda)
    End Function

    <WebMethod()> _
    Function Escribir(ByVal pCustomerID As String,
                      ByVal pCompanyName As String,
                      ByVal pContactName As String,
                        ByVal pContactTitle As String,
                        ByVal pAddress As String,
                        ByVal pCity As String,
                        ByVal pRegion As String,
                        ByVal pPostalCode As String,
                        ByVal pCountry As String,
                        ByVal pPhone As String,
                        ByVal pFax As String,
                        ByVal pModo As Integer)
        Dim oBL As New blCustomers
        oBL.Escribir(pCustomerID,
                     pCompanyName,
                     pContactName,
                     pContactTitle,
                     pAddress,
                     pCity,
                     pRegion,
                     pPostalCode,
                     pCountry,
                     pPhone,
                     pFax,
                     pModo)
    End Function

    <WebMethod()> _
    Function GetCustomerById(ByVal pCustomerID As String) As beCustomers
        Dim oBL As New blCustomers
        Return oBL.GetCustomerById(pCustomerID)
    End Function
End Class